#include<cstdio>
#include<cstring>

const int maxn=400005;

char p[maxn];
int cnt,ans[maxn],next[maxn],m;

void make_next()
{
	m=strlen(p+1);
	next[1]=0;
	int k=0;
	for(int i=2;i<=m;i++)
	{
		while(k>0&&p[k+1]!=p[i])
			k=next[k];
		if(p[k+1]==p[i])k++;
		next[i]=k;
	}
}

int main()
{
	while(scanf("%s",p+1)!=EOF)
	{
		make_next();
		cnt=1;
		ans[1]=m;
		while(next[m])
		{
			cnt++;
			ans[cnt]=next[m];
			m=next[m];
		}
		for(int i=cnt;i>1;i--)
			printf("%d ",ans[i]);
		printf("%d\n",ans[1]);
	}
	return 0;
}

